package com.djx.auth.controller;

import com.djx.auth.service.AuthService;
import com.djx.common.domain.User;
import com.djx.common.domain.response.UserResponse;
import com.djx.common.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class AuthController {
    @Resource
    private AuthService authService;


    /**
     * 登录的方法
     * @param user
     * @return
     */
    @PostMapping("/doLogin")
    public Result<UserResponse> doLogin(@RequestBody User user){
        Result<UserResponse> result=authService.doLogin(user);
        return result;
    }
}
